//
//  VERealNameTextTableViewCell.m
//  VEMoneyPorject
//
//  Created by BlueWind on 2018/9/27.
//  Copyright © 2018年 陈建. All rights reserved.
//

#import "VERealNameTextTableViewCell.h"

@implementation VERealNameTextTableViewCell

/** 返回循环利用的cell */
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self= [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self loadDefaultSetting];
    }
    return self;
}

/** 加载默认UI元素和需要的数据 */
- (void)loadDefaultSetting {
    
    self.textNew = [[BRTextField alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-60, 50)];
    [self.contentView addSubview:self.textNew];
    [self.textNew mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(UIEdgeInsetsMake(GAP8, GAP15, 0, GAP15));
    }];
    self.textNew.textAlignment = NSTextAlignmentLeft;
    self.textNew.font = kFont(16);
    self.textNew.textColor = [UIColor colorWithHexString:kDetailTextGrayBlackColor];
    [self.textNew layerBorderWithWidth:0.5 borderColor:[UIColor colorWithHexString:kDetailTextGrayBlackColor]];
    self.textNew.layerCornerRadius = 6;
    
    UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 12, 0)];
    leftView.backgroundColor = [UIColor whiteColor];
    self.textNew.leftView = leftView;
    self.textNew.leftViewMode = UITextFieldViewModeAlways;
    
    
    UIImageView *jiantou = [UIImageView new];
    jiantou.userInteractionEnabled = NO;
    _jiantou = jiantou;
    [self.textNew addSubview:jiantou];
    [jiantou mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.textNew);
        make.right.equalTo(self.textNew.mas_right).offset(-GAP8);
        make.size.mas_equalTo(CGSizeMake(18, 18));
    }];
    jiantou.image = IMG(@"上拉");
}

@end
